#ifndef SERVER_INTERFACE_H
#define SERVER_INTERFACE_H

#include "pipe_module.h"

class IServer : public utility::network::pipe_event_handler
{   
protected:
    virtual ~IServer() {}
public:
    virtual void Release() = 0;
    
    IServer(utility::network::pipe * pPipe)
    {
        m_pPipe = pPipe;
    }

    void send(void * message, size_t message_length)
    {
        if (m_pPipe)
            m_pPipe->send(message, message_length);
    }

    utility::network::PIPEID GetPipeId()
    {
        return m_pPipe->get_remote_id();
    }
protected:
    utility::network::pipe * m_pPipe;
};

#endif  // endif of SERVER_INTERFACE_H
